#include <stdio.h>
#include <stdlib.h>

char min_element(char * array, int first, int end)
{
	if (NULL == array) {
		return -1;
	}
	if (array[first] <= array[end]) {
		return array[first];
	}
	else {
		int mid = (end+first) / 2;
		if (array[mid] >= array[first]) {
			return min_element(array, mid+1, end);
		}
		else if (array[mid] < array[end]) {
			return min_element(array, first+1, mid);
		}
	}
}

/*
int main()
{
	char array[] = {2, 3, 4, 5, 6, 1};
	char array1[] = {1, 2, 3, 4, 5, 6};
	char array2[] = {4, 5, 6, 1, 2, 3};
	printf("%d\n", min_element(array, 0, 5));
	printf("%d\n", min_element(array1, 0, 5));
	printf("%d\n", min_element(array2, 0, 5));
}
*/
